package edu.hda.pt.utils;

import java.io.Serializable;

/**
 * The Stream class provides objects for storing stream attributes like the
 * frame size and the stream state.
 * 
 * @author Marc Hammerton
 * 
 */
public class Stream implements Serializable {

	private static final long serialVersionUID = -7859269929694579072L;

	private int fs;

	/**
	 * The state a stream can have.
	 * 
	 * @author Marc Hammerton
	 * 
	 */
	public enum StreamState {
		START, RUNNING, FINISH, STOPPED
	};

	private StreamState state = StreamState.STOPPED;

	/**
	 * Default constructor
	 */
	public Stream() {
	}

	/**
	 * Constructor, setting directly the frame size
	 * 
	 * @param fs
	 *            - The frame size for the stream
	 */
	public Stream(int fs) {
		this.setFs(fs);
	}

	/**
	 * Sets the frame size
	 * 
	 * @param fs
	 *            - the frame size to set
	 */
	public void setFs(int fs) {
		this.fs = fs;
	}

	/**
	 * @return the frame size
	 */
	public int getFs() {
		return fs;
	}

	/**
	 * Sets the stream state
	 * 
	 * @param state
	 *            - the state to set
	 */
	public void setState(StreamState state) {
		this.state = state;
	}

	/**
	 * @return the stream state
	 */
	public StreamState getState() {
		return state;
	}

}
